﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace LibArchivumAeternum
{
    [Serializable, Flags]
    public enum EqualityCheck
    {
        ModificationDate = 1,
        Size = 2,
        CheckSum = 4,
        // Content = 8
    }

    [Serializable, Flags]
    public enum ApplyTo
    {
        Files = 1,
        Directories = 2
    }

    [Serializable]
    public class Exclude
    {
        [XmlAttribute]
        public string Pattern { get; set; }

        [XmlAttribute]
        public ApplyTo ApplyTo { get; set; }
    }

    [Serializable]
    public class Task
    {
        [XmlAttribute]
        public string Name { get; set; }

        public List<string> Sources { get; set; }

        public List<Exclude> Excludes { get; set; }

        [XmlAttribute]
        public string Destination { get; set; }

        [XmlAttribute]
        public EqualityCheck EqualityCheck { get; set; }
    }

    [Serializable]
    public class Configuration
    {
        [XmlAttribute]
        public string Version { get; set; }
        public List<Task> Tasks { get; set; }
    }
}